\(\int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx\) [747]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 41, antiderivative size = 62 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=-\frac {2 a (i A+B)}{7 f (c-i c \tan (e+f x))^{7/2}}+\frac {2 a B}{5 c f (c-i c \tan (e+f x))^{5/2}} \]

[Out]

-2/7*a*(I*A+B)/f/(c-I*c*tan(f*x+e))^(7/2)+2/5*a*B/c/f/(c-I*c*tan(f*x+e))^(5/2)

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 45} \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=\frac {2 a B}{5 c f (c-i c \tan (e+f x))^{5/2}}-\frac {2 a (B+i A)}{7 f (c-i c \tan (e+f x))^{7/2}} \]

[In]

Int[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^(7/2),x]

[Out]

(-2*a*(I*A + B))/(7*f*(c - I*c*Tan[e + f*x])^(7/2)) + (2*a*B)/(5*c*f*(c - I*c*Tan[e + f*x])^(5/2))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(c-i c x)^{9/2}} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {(a c) \text {Subst}\left (\int \left (\frac {A-i B}{(c-i c x)^{9/2}}+\frac {i B}{c (c-i c x)^{7/2}}\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {2 a (i A+B)}{7 f (c-i c \tan (e+f x))^{7/2}}+\frac {2 a B}{5 c f (c-i c \tan (e+f x))^{5/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 5.64 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.94 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=-\frac {2 a \left (\frac {5 (i A+B)}{(c-i c \tan (e+f x))^{7/2}}-\frac {7 B}{c (c-i c \tan (e+f x))^{5/2}}\right )}{35 f} \]

[In]

Integrate[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^(7/2),x]

[Out]

(-2*a*((5*(I*A + B))/(c - I*c*Tan[e + f*x])^(7/2) - (7*B)/(c*(c - I*c*Tan[e + f*x])^(5/2))))/(35*f)

Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.85

method result size
derivativedivides \(\frac {2 i a \left (-\frac {c \left (-i B +A \right )}{7 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {7}{2}}}-\frac {i B}{5 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}}\right )}{f c}\) \(53\)
default \(\frac {2 i a \left (-\frac {c \left (-i B +A \right )}{7 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {7}{2}}}-\frac {i B}{5 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}}\right )}{f c}\) \(53\)
risch \(-\frac {a \left (5 i A \,{\mathrm e}^{6 i \left (f x +e \right )}+5 B \,{\mathrm e}^{6 i \left (f x +e \right )}+15 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+B \,{\mathrm e}^{4 i \left (f x +e \right )}+15 i A \,{\mathrm e}^{2 i \left (f x +e \right )}-13 B \,{\mathrm e}^{2 i \left (f x +e \right )}+5 i A -9 B \right ) \sqrt {2}}{280 c^{3} \sqrt {\frac {c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}}\, f}\) \(112\)
parts \(\frac {2 i A a c \left (-\frac {1}{16 c^{4} \sqrt {c -i c \tan \left (f x +e \right )}}-\frac {1}{24 c^{3} \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}}-\frac {1}{20 c^{2} \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}}-\frac {1}{14 c \left (c -i c \tan \left (f x +e \right )\right )^{\frac {7}{2}}}+\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{32 c^{\frac {9}{2}}}\right )}{f}+\frac {a \left (i A +B \right ) \left (-\frac {1}{7 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {7}{2}}}+\frac {1}{8 c^{3} \sqrt {c -i c \tan \left (f x +e \right )}}+\frac {1}{12 c^{2} \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}}+\frac {1}{10 c \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}}-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{16 c^{\frac {7}{2}}}\right )}{f}-\frac {2 a B \left (-\frac {3}{20 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}}+\frac {1}{16 c^{2} \sqrt {c -i c \tan \left (f x +e \right )}}+\frac {1}{24 c \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}}+\frac {c}{14 \left (c -i c \tan \left (f x +e \right )\right )^{\frac {7}{2}}}-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{32 c^{\frac {5}{2}}}\right )}{f c}\) \(348\)

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^(7/2),x,method=_RETURNVERBOSE)

[Out]

2*I/f*a/c*(-1/7*c*(A-I*B)/(c-I*c*tan(f*x+e))^(7/2)-1/5*I*B/(c-I*c*tan(f*x+e))^(5/2))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 113 vs. \(2 (48) = 96\).

Time = 0.28 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.82 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=-\frac {\sqrt {2} {\left (5 \, {\left (i \, A + B\right )} a e^{\left (8 i \, f x + 8 i \, e\right )} + 2 \, {\left (10 i \, A + 3 \, B\right )} a e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, {\left (5 i \, A - 2 \, B\right )} a e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (10 i \, A - 11 \, B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )} - {\left (-5 i \, A + 9 \, B\right )} a\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}}{280 \, c^{4} f} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^(7/2),x, algorithm="fricas")

[Out]

-1/280*sqrt(2)*(5*(I*A + B)*a*e^(8*I*f*x + 8*I*e) + 2*(10*I*A + 3*B)*a*e^(6*I*f*x + 6*I*e) + 6*(5*I*A - 2*B)*a
*e^(4*I*f*x + 4*I*e) + 2*(10*I*A - 11*B)*a*e^(2*I*f*x + 2*I*e) - (-5*I*A + 9*B)*a)*sqrt(c/(e^(2*I*f*x + 2*I*e)
 + 1))/(c^4*f)

Sympy [F]

\[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=i a \left (\int \left (- \frac {i A}{i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - 3 c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - 3 i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} + c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c}}\right )\, dx + \int \frac {A \tan {\left (e + f x \right )}}{i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - 3 c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - 3 i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} + c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c}}\, dx + \int \frac {B \tan ^{2}{\left (e + f x \right )}}{i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - 3 c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - 3 i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} + c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c}}\, dx + \int \left (- \frac {i B \tan {\left (e + f x \right )}}{i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - 3 c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - 3 i c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} + c^{3} \sqrt {- i c \tan {\left (e + f x \right )} + c}}\right )\, dx\right ) \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**(7/2),x)

[Out]

I*a*(Integral(-I*A/(I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x)**3 - 3*c**3*sqrt(-I*c*tan(e + f*x) + c)*ta
n(e + f*x)**2 - 3*I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x) + c**3*sqrt(-I*c*tan(e + f*x) + c)), x) + In
tegral(A*tan(e + f*x)/(I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x)**3 - 3*c**3*sqrt(-I*c*tan(e + f*x) + c)
*tan(e + f*x)**2 - 3*I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x) + c**3*sqrt(-I*c*tan(e + f*x) + c)), x) +
 Integral(B*tan(e + f*x)**2/(I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x)**3 - 3*c**3*sqrt(-I*c*tan(e + f*x
) + c)*tan(e + f*x)**2 - 3*I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x) + c**3*sqrt(-I*c*tan(e + f*x) + c))
, x) + Integral(-I*B*tan(e + f*x)/(I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x)**3 - 3*c**3*sqrt(-I*c*tan(e
 + f*x) + c)*tan(e + f*x)**2 - 3*I*c**3*sqrt(-I*c*tan(e + f*x) + c)*tan(e + f*x) + c**3*sqrt(-I*c*tan(e + f*x)
 + c)), x))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.74 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=-\frac {2 i \, {\left (7 i \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )} B a + 5 \, {\left (A - i \, B\right )} a c\right )}}{35 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {7}{2}} c f} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^(7/2),x, algorithm="maxima")

[Out]

-2/35*I*(7*I*(-I*c*tan(f*x + e) + c)*B*a + 5*(A - I*B)*a*c)/((-I*c*tan(f*x + e) + c)^(7/2)*c*f)

Giac [F]

\[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=\int { \frac {{\left (B \tan \left (f x + e\right ) + A\right )} {\left (i \, a \tan \left (f x + e\right ) + a\right )}}{{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {7}{2}}} \,d x } \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^(7/2),x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)*(I*a*tan(f*x + e) + a)/(-I*c*tan(f*x + e) + c)^(7/2), x)

Mupad [B] (verification not implemented)

Time = 10.38 (sec) , antiderivative size = 157, normalized size of antiderivative = 2.53 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^{7/2}} \, dx=-\sqrt {c-\frac {c\,\sin \left (e+f\,x\right )\,1{}\mathrm {i}}{\cos \left (e+f\,x\right )}}\,\left (\frac {a\,\left (5\,A+B\,9{}\mathrm {i}\right )\,1{}\mathrm {i}}{280\,c^4\,f}+\frac {a\,{\mathrm {e}}^{e\,8{}\mathrm {i}+f\,x\,8{}\mathrm {i}}\,\left (A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{56\,c^4\,f}+\frac {a\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,\left (5\,A+B\,2{}\mathrm {i}\right )\,3{}\mathrm {i}}{140\,c^4\,f}+\frac {a\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,\left (10\,A+B\,11{}\mathrm {i}\right )\,1{}\mathrm {i}}{140\,c^4\,f}+\frac {a\,{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}\,\left (10\,A-B\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{140\,c^4\,f}\right ) \]

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i))/(c - c*tan(e + f*x)*1i)^(7/2),x)

[Out]

-(c - (c*sin(e + f*x)*1i)/cos(e + f*x))^(1/2)*((a*(5*A + B*9i)*1i)/(280*c^4*f) + (a*exp(e*8i + f*x*8i)*(A - B*
1i)*1i)/(56*c^4*f) + (a*exp(e*4i + f*x*4i)*(5*A + B*2i)*3i)/(140*c^4*f) + (a*exp(e*2i + f*x*2i)*(10*A + B*11i)
*1i)/(140*c^4*f) + (a*exp(e*6i + f*x*6i)*(10*A - B*3i)*1i)/(140*c^4*f))